Skip to content

[9.1](backport #45076) [OTel] Convert []any-nested mapstr.M#45082

Merged
pickypg merged 1 commit into9.1from
mergify/bp/9.1/pr-45076
Jun 27, 2025
Merged

[9.1](backport #45076) [OTel] Convert []any-nested mapstr.M#45082
pickypg merged 1 commit into9.1from
mergify/bp/9.1/pr-45076

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify Bot commented Jun 26, 2025

This adds the reflective capture of mapstr.M in addition to map[string]any for []any.

I noticed, at runtime, the cat_shards metricset produces mapstr.M in a nested array even though the autoops_es code does not produce it that way, libbeat does:

case reflect.Map, reflect.Struct:
var m mapstr.M
err := marshalUnmarshal(value, &m)
if err != nil {
return m, []error{fmt.Errorf("key=%v: error converting %T to mapstr.M: %w", joinKeys(keys...), value, err)}
}
return m, nil

Proposed commit message

Convert inner slice/array mapstr.M to map[string]any.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

None. This improves compatibility.

Author's Checklist

  • Validate tests.

How to test this PR locally

Run the Elastic Agent with autoops_es

Related issues

This adds the reflective capture of `mapstr.M` in addition to
`map[string]any` for `[]any`.

(cherry picked from commit 8d191b7)
@mergify mergify Bot added the backport label Jun 26, 2025
@mergify mergify Bot requested a review from a team as a code owner June 26, 2025 22:13
@mergify mergify Bot added the backport label Jun 26, 2025
@mergify mergify Bot requested review from AndersonQ and belimawr and removed request for a team June 26, 2025 22:13
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jun 26, 2025
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@github-actions github-actions Bot added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Jun 26, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jun 26, 2025
@pickypg pickypg enabled auto-merge (squash) June 26, 2025 22:16
@pickypg pickypg merged commit 25e32f8 into 9.1 Jun 27, 2025
204 checks passed
@pickypg pickypg deleted the mergify/bp/9.1/pr-45076 branch June 27, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants